<?php 
    $sessao = new Zend_Session_Namespace('Parametros');
?>

<link rel="stylesheet" href="<?php echo $this->urlbase.'/public/media/css/hint.min.css' ?>" />

<div class="topo">
    <div class="content">
        <div class="cnt-calendario">
            <div class="tl">Calendário de Provas</div>
            <div class="calendario">
                <?php //echo Calendario::buscaCalendario(); ?>  
            </div>
            <ul class="lista_calendario">
            <?php
            $db = Zend_Db_Table_Abstract::getDefaultAdapter();
            $cal = array();
            //$cal = $db->fetchAll('SELECT SQL_CACHE *, DAY(CAL_DAT) as DIA, MONTH(CAL_DAT) as MES FROM CALENDARIO WHERE YEAR(CAL_DAT) = "'. date('Y').'" and MONTH(CAL_DAT) = "'. date('m').'" and CAL_STA = 1 ORDER BY CAL_DAT ASC, CAL_NOM ASC LIMIT 18');
            $count = 0;
            foreach($cal as $c){   
                $count++;
                if( $c['DIA'] < 10) $c['DIA'] = "0".$c['DIA'];
            ?>
                <li><strong><?php echo $c['DIA'].'/'.$c['MES'];?></strong> | <?php echo $c['CAL_NOM'];?>.</li>
            <?php } ?>
            </ul>
        </div>
        <?php if($count > 9) echo '<script> $(function(){ $(".lista_calendario").css("width","460px"); });</script>'; ?>
        <ul class="list-emp">
            <li>
                <a href="<?php echo $this->urlbase.'/'; ?>" class="logo"></a>
            </li>
            
             <li>
                <address>
                <?php if(isset($sessao->parametros['PAR_TEL']) && strlen($sessao->parametros['PAR_TEL']) > 5){ ?>
                    <span class="tel"><?php echo str_replace('54','<span class="pre">54</span>',$sessao->parametros['PAR_TEL']); ?></span><?php } ?><br>
                <?php echo $sessao->parametros['PAR_END']; ?>
                </address>
            </li>
            <li>
                <?php if(strlen($sessao->parametros['PAR_FAC']) > 1){ ?>
                <a href="<?php echo $sessao->parametros['PAR_FAC']; ?>" title="Facebook" class="sociais facebook tp" target="_blank"></a>
                <?php } ?>
                <?php if(strlen($sessao->parametros['PAR_TWI']) > 1){ ?>
                <a href="<?php echo $sessao->parametros['PAR_TWI']; ?>" title="Twitter" class="sociais twitter tp" target="_blank"></a>
                <?php } ?>
                <?php if(strlen($sessao->parametros['PAR_INS']) > 1){ ?>
                <a href="<?php echo $sessao->parametros['PAR_INS']; ?>" title="Instagram" class="sociais instragam tp" target="_blank"></a>
                <?php } ?>
            </li>
        </ul>
    </div>
</div>
<div class="bottom">
    <div class="content">
        <ul>
            <li><a href="<?php echo $this->urlbase.'/'; ?>">Piti Redação</a></li>
            <li>|</li>
            <li>Todos os Direitos Reservados &copy; 2014</li>
        </ul>
    </div>
</div>
<div id="script" style="display: none;"></div>

